package com.baizhi;

import org.apache.activemq.command.ActiveMQQueue;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.jms.Queue;
import javax.servlet.Filter;
import javax.servlet.FilterRegistration;

@SpringBootApplication
@MapperScan("com.baizhi.dao")
@EnableTransactionManagement
public class CmfzApplication {

    public static void main(String[] args) {
        SpringApplication.run(CmfzApplication.class, args);
    }



    //创建一个目的地
    @Bean
    public Queue queue(){
        //放入目的地名字
        return new ActiveMQQueue("持名法州日志");
    }


//    //设置要拦截的页面
//    @Bean
//    public FilterRegistrationBean registrationBean(){
//        FilterRegistrationBean filterFilterRegistrationBean = new FilterRegistrationBean();
//        filterFilterRegistrationBean.setFilter(new MyFileter());
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_banner.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_guru.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_article.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_userlog.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_admin.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_user.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_user_echarts.jsp");
//        filterFilterRegistrationBean.addUrlPatterns("/jsp/cmfz_houtai.jsp");
//        filterFilterRegistrationBean.setName("LogCostFilter");
//        filterFilterRegistrationBean.setOrder(1);
//        return filterFilterRegistrationBean;
//    }

}
